
class Event {
    constructor() {
        this.events = {};
    }

    $emit(name, value) {
        if (this.events[name]) {
            this.events[name].forEach((item) => {
                item(value)
            })
        }
    }
    $on(name, value) {
        if (!this.events[name]) {
            this.events[name] = [];
        }
        this.events[name].push(value);
    }
}

export default new Event()




